<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <title>{:cache('system')['web_site_title']}</title>
    <link rel="stylesheet" href="/static/admin/lib/layui/css/layui.css"/>
    <link rel="stylesheet" href="/static/index/css/sign.css">
</head>
<body>
<img src="/static/index/img/icon90.png" alt="" class="back" onclick="load_href('{:url(\'user/index\')}',2)">
<div>
    <img src="/static/index/img/icon86.png" alt="" class="top-bg">
    <div class="content">
        <div class="date flex">
            <img src="/static/index/img/icon87.png" alt="">
            <div class="date-box">
                <div class="continuous flex">连续签到 <span class="always_day">{$always_day}</span> 天</div>
                <div class="TheCumulative flex">累计签到 <span class="sign_day">{$sign_day}</span> 天</div>
            </div>
        </div>
        <div class="bg">
            <div class="selectTime flex-center">
                <img src="/static/index/img/icon91.png" alt="" onclick="location.href='{:url(\'user/sign\')}?date={$reduce}'">
                <span>{$date}</span>
                <img src="/static/index/img/icon92.png" alt="" onclick="location.href='{:url(\'user/sign\')}?date={$plus}'">
            </div>
            <div class="weeks flex-layout">
                {foreach name="week" item="vo"}
                <div>{$vo}</div>
                {/foreach}
            </div>
            <div class="day flex">
                {foreach name="month" item="vo" key="key"}
                <?php $key = array_search($vo['week'],$week);?>
                {if $vo['day'] == 1}
                <?php for($i=1;$i<=$key;$i++){?>
                <div class="color1 flex-center">
                    <div></div>
                </div>
                <?php }?>
                {/if}
                <div class="{if $vo.status == 3}color2 {else}color1 {/if} {if $vo.status == 1}active{/if} flex-center">
                    <div>{$vo['day']}</div>
                </div>
                {/foreach}
            </div>
            {if $is_day_sign}
            <div class="btn" style="background: #9F9F9F">今日已签到</div>
            {else}
            <div class="btn signAdd">立即签到</div>
            {/if}
        </div>
    </div>
</div>
<div class="modal flex-center" style="display: none;">
    <div>
        <div class="bg">
            <img src="/static/index/img/icon89.png" alt="">
            <div class="text">
                <div class="integral flex-center"></div>
                <div class="signIn flex-center">已连续签到 <span class="always_day"></span>天</div>
            </div>
            <!-- 确认按钮 -->
            <div class="btn-3"></div>
        </div>
        <div class="flex-center">
            <img src="/static/index/img/icon88.png" alt="" class="close">
        </div>
    </div>
</div>
<script src="/static/index/js/jquery-3.4.1.min.js"></script>
<script src="/static/index/js/flexible.js"></script>
<script src="/static/admin/lib/layui/layui.js"></script>
<script src="/static/index/js/common.js"></script>
<script>
    $(".reduce").click(function (){
        location.href = '{:url("user/sign")}?data=reduce';
    });

    $('.close').click(function () {
        location.reload();
    });

    $('.btn-3').click(function () {
        location.reload();
    })

    $('.signAdd').click(function () {
        layer.msg('<div><i class="layui-icon layui-icon-loading-1 layui-anim layui-anim-rotate layui-anim-loop"></i> 加载中...', {
            shade: 0.8,
            time: 99999
        });
        $.ajax({
            type: 'POST',
            url: '{:url("user/signSdd")}',
            dataType: "json",
            success: function (data) {
                layer.closeAll();
                if(data.code == 1){
                    $(".integral").html(data.msg);
                    $(".always_day").html(data.always_day);
                    $(".sign_day").html(data.sign_day);
                    $('.modal').show()
                }else{
                    layer.msg(data.msg);
                }
            }
        });
    })
</script>
</body>
</html>